﻿using Core.Identity.Tokens.Features.Generate;
using Core.Identity.Tokens.Features.Refresh;
using Core.Identity.Tokens.Models;
using Core.Models;

namespace Core.Identity.Tokens;

/// <summary>
/// Token服务
/// </summary>
public interface ITokenService
{
    /// <summary>
    /// 生成Token
    /// </summary>
    /// <param name="request"></param>
    /// <param name="ipAddress"></param>
    /// <param name="cancellationToken"></param>
    /// <returns>TokenResponse</returns>
    Task<Result<TokenResponse>> GenerateTokenAsync(TokenGenerationCommand request, string ipAddress, CancellationToken cancellationToken = default);

    /// <summary>
    /// 刷新Token
    /// </summary>
    /// <param name="request"></param>
    /// <param name="ipAddress"></param>
    /// <param name="cancellationToken"></param>
    /// <returns>TokenResponse</returns>
    Task<Result<TokenResponse>> RefreshTokenAsync(RefreshTokenCommand request, string ipAddress, CancellationToken cancellationToken = default);

}
